<?php

namespace App\Extensions;

class Action extends \Encore\Admin\Actions\Action
{
    public function __toString()
    {
        return $this->render();
    }

    protected function htmlButton($name, $bgClass = 'primary', $fa = ''): string
    {
        $i = $fa ? sprintf('<i class="fa fa-%s"></i>&nbsp;&nbsp', $fa) : '';
        return <<<HTML
        <a class="{$this->getElementClass()} btn btn-sm btn-{$bgClass}">
        {$i}
        <span class="hidden-xs">{$name}</span>
        </a>
HTML;
    }
}
